import request from '@/utils/request'

export function listMechanism(query) {
  return request({
    url: '/mechanism/list',
    method: 'get',
    params: query
  })
}

export function listTotalMechanism(query) {
  return request({
    url: '/mechanism/totalList',
    method: 'get',
    params: query
  })
}

export function createMechanism(data) {
  return request({
    url: '/mechanism/create',
    method: 'post',
    data
  })
}

export function checkMechanismName(query) {
  return request({
    url: '/mechanism/name',
    method: 'get',
    params: query
  })
}

export function choseAffiliation(query) {
  return request({
    url: '/mechanism/affiliation',
    method: 'get',
    params: query
  })
}

export function showMechanim(data) {
  return request({
    url: '/mechanism/showMechanim',
    method: 'post',
    data
  })
}

export function mechanismCheckSuccess(query) {
  return request({
    url: '/mechanism/checkSuccess',
    method: 'get',
    params: query
  })
}

export function subAccount(query) {
  return request({
    url: '/mechanism/subAccount',
    method: 'get',
    params: query
  })
}

export function getAffiliation(query) {
  return request({
    url: '/mechanism/getaffiliation',
    method: 'get',
    params: query
  })
}

export function mechanismCheckDefault(query) {
  return request({
    url: '/mechanism/checkDefault',
    method: 'get',
    params: query
  })
}

export function importMechanism(query) {
  return request({
    url: '/mechanism/import',
    method: 'post',
    data: {
      ...query
    }
  })
}

export function reimportMechanism(query) {
  return request({
    url: '/mechanism/reimport',
    method: 'post',
    data: {
      ...query
    }
  })
}

export function readMechanism(data) {
  return request({
    url: '/mechanism/read',
    method: 'get',
    data
  })
}

export function updateMechanism(data) {
  return request({
    url: '/mechanism/update',
    method: 'post',
    data
  })
}

export function deleteMechanism(data) {
  return request({
    url: '/mechanism/delete',
    method: 'post',
    data
  })
}
